home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 38 / Amiga Format CD38 (1999-03-15)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-04].iso / -websites- / haage&partner / ftp / softlogik / pgs33a_33.lha / 3.3a / help.lha / help.rexx
OS/2 REXX Batch file  |  1997-11-07  |  2KB  |  68 lines

  1. /* 
  2.    Copyright 1997 SoftLogik Publishing Corporation
  3.    May not be distributed without SoftLogik Publishing Corporation's express written permission 
  4.    $VER: Help.rexx 1.1 (97.11.07)
  5. */
  6.  
  7. OPTIONS RESULTS
  8. TRACE OFF
  9.  
  10. /* Make sure rexx support is opened */
  11. IF ~SHOW('L','rexxsupport.library') THEN
  12.    CALL ADDLIB('rexxsupport.library',0,-30)
  13.  
  14. helppath = arg(1)
  15. href = arg(2)
  16. anchor = arg(3)
  17.  
  18. /* The next three lines say:                                  */
  19. /* 1) Form a queue (before starting or send commands to HHV.) */
  20. /* 2) See who is at the front of the queue.                   */
  21. /* 3) If you're not at the front of the queue,                */
  22. /*       leave by the nearest EXIT.                           */
  23.  
  24. call setclip('Own_HHV', getclip('Own_HHV') || pragma('I'))
  25. parse value getclip('Own_HHV') with Owner 9
  26. if Owner ~= pragma('I') then exit
  27.  
  28. if ~show(P, 'HHV') then do
  29.     /* Run help viewer */
  30.     ADDRESS COMMAND
  31.     'run >nil: pagestream3:hhv SETPATH='helppath
  32.  
  33.     /* Wait until the ARexx port shows up */
  34.     do 20
  35.         if ~show(P, 'HHV') then call delay(50)
  36.     end
  37.  
  38.     /* If the ARexx port didn't show up, alert the user and exit */
  39.     if ~show(P, 'HHV') then do
  40.         /* The next line resets 'Own_HHV' to '' so that  */
  41.         /* LATER instances of help.rexx don't just exit. */
  42.         call setclip('Own_HHV')
  43.  
  44.         EXIT
  45.     end
  46.  
  47.     ADDRESS 'HHV'
  48. end
  49. else do
  50.     ADDRESS 'HHV'
  51.     'setpath 'helppath
  52. end
  53.  
  54. 'screentofront'
  55. if anchor~='' then href=href'#'anchor
  56.  
  57. 'currenturl'
  58. if (RC = 0) then do
  59.     'goto 'href
  60. end
  61. else do
  62.     'open 'href
  63. end
  64.  
  65. /* The next line resets 'Own_HHV' to '' so that  */
  66. /* LATER instances of help.rexx don't just exit. */
  67. call setclip('Own_HHV')
  68.